package com.example.demo.util;

import java.util.Base64;

public class EncodeUtil {


    public static String encode(String str) {
        return Base64.getEncoder().encodeToString(str.getBytes());
    }

    public static String decode(String str) {
        byte[] decodedBytes = Base64.getDecoder().decode(str);
        return new String(decodedBytes);
    }

    public static void main(String[] args) {
        System.out.println(encode("我的test"));
        System.out.println(decode(encode("我的手动阀")));
    }

}
